<?php
namespace app\api\validate;

use think\Validate;

class MemberValidate extends Validate
{
    protected $rule = [
        'nickname' => 'require|alphaDash',
        'birthday' => 'require|dateFormat:y-m-d',
        'sex'  => 'require|in:男,女',
    ];
    protected $message = [
        'nickname.require' => '请输入宝宝昵称',
        'nickname.chsDash'  => '请输入正确的宝宝昵称【名字只能为：汉字、字母、数字和下划线】',
        
        'birthday.require'  => '请输入宝宝的生日',
        'birthday.dateFormat'  => '请输入正确的生日格式【例:2000-01-03】',


        'sex.require'  => '请选择宝宝的性别',
        'sex.in'  => '宝宝的性别只能为：男、女',
       
    ];

    protected $scene = [
        'set_info'  => ['nickname', 'birthday', 'sex'],
    ];
}